home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 44
/
Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso
/
-serious-
/
wb
/
textloader
/
rexx
/
sendtopageliner.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-07-12
|
2KB
|
92 lines
/* Send text from TLNG to PageLiner */
/* PL-V1.0 © 13.03.99 by Jochen Grus */
OPTIONS RESULTS
TRACE OFF
/* Make sure rexx support is opened */
IF ~SHOW('L','rexxsupport.library') THEN
CALL ADDLIB('rexxsupport.library',0,-30)
/* set the default PageLiner path */
plpath='PageStream3:PageLiner'
preffile='PageStream3:SendtoPageLiner.prefs'
/* If PageLiner doesn't exist in the default path, check SendtoPageLiner.prefs */
if ~exists(plpath) then do
if open(.ifile, preffile, 'R') then do
plpath=readln(.ifile)
call close(.ifile)
askuser='no'
end
else do
askuser='yes'
end
/* If PageLiner doesn't exist in the set pref path, ask the user where it is */
if ~exists(plpath) | askuser='yes' then do
getfile TITLE "'Please locate PageLiner'" load path "'PageStream3:'" file 'PageLiner' posbutton 'Ok' negbutton 'Cancel'
if RC=10 then signal cancel
plpath=result
if open(.ifile, preffile, 'W') then do
call writeln(.ifile, plpath)
call close(.ifile)
end
end
end
/* Run PageLiner */
ADDRESS COMMAND
'run >nil:' PLpath
/* Wait until the ARexx port shows up */
do 20
if ~show(P, 'PAGELINER') then call delay(50)
end
/* If the ARexx port didn't show up, alert the user and exit */
if ~show(P, 'PAGELINER') then do
ADDRESS 'PAGESTREAM'
allocarexxrequester '"Send to Editor Error!"' 368 59
reqhandle=result
addarexxgadget reqhandle EXIT 286 42 70 label "_Exit"
Exithandle=result
addarexxgadget reqhandle TEXT 8 10 352 border none string "'PageLiner could not be started.'"
doarexxrequester reqhandle
freearexxrequester reqhandle
'refresh continue'
'lockinterface false'
EXIT
end
ADDRESS 'PAGELINER'
'open ram:clipboards/0'
'cursor down'
/* Wait for the user to finish in PageLiner */
do forever
if show(P, 'PAGELINER') then do
'getarticle ram:clipboards/0'
if rc=0 then call delay(50)
else signal update
end
else signal update
end
/* Update PageStream and exit */
'inserttext file ram:clipboards/0'
/* deselect the text if rquired */
if sID=eID then selecttext none
signal cancel
CANCEL:
ADDRESS 'PAGESTREAM'
'refresh continue'
'lockinterface false'
ADDRESS COMMAND
EXIT